﻿using System.Web.UI;
using com.nm.Helper;
using com.nm.library.Helper;

namespace com.nm.library.Pages
{
    /// <summary>
    /// 
    /// </summary>
    public class BaseMaster : MasterPage {
		public void SetValue(string key, object value) {
			ViewState[key] = value;
		}

		public T GetValue<T>(string key, T dv) {
			var o = ViewState[key];
			if (o == null) return dv;
			try {
				return (T)o;
			} catch {
				return dv;
			}

		}
       /// <summary>
       /// 正在使用 当前用户ID
       /// </summary>
       //public int UserID => this.Session.Get("CurrentUserId", 0);

       /// 测试中...
       public int UserID => this.GetCurrentUserId();
    }
}
